package com.mall.user.domain.model;

public record StoreName(String name) {
    public StoreName {
        //商店名称长度不能为空且必须在3到50个字符之间
        if (name == null || name.length() < 3 || name.length() > 50) {
            throw new IllegalArgumentException("商店名称长度不能为空且必须在3到50个字符之间");
        }
    }

    public static StoreName of(String name) {
        return new StoreName(name);
    }
}
